import request from '@/utils/request'

// 获取系统配置
export const getSystemConfig = () => {
  return request({
    url: '/admin/system/config',
    method: 'get'
  })
}

// 更新系统配置
export const updateSystemConfig = (data) => {
  return request({
    url: '/admin/system/config',
    method: 'put',
    data
  })
}

// 获取管理员列表
export const getAdmins = (params) => {
  return request({
    url: '/admin/admins',
    method: 'get',
    params
  })
}

// 创建管理员
export const createAdmin = (data) => {
  return request({
    url: '/admin/admins',
    method: 'post',
    data
  })
}

// 更新管理员
export const updateAdmin = (id, data) => {
  return request({
    url: `/admin/admins/${id}`,
    method: 'put',
    data
  })
}

// 删除管理员
export const deleteAdmin = (id) => {
  return request({
    url: `/admin/admins/${id}`,
    method: 'delete'
  })
}

// 更新管理员状态
export const updateAdminStatus = (id, status) => {
  return request({
    url: `/admin/admins/${id}/status`,
    method: 'put',
    data: { status }
  })
}

// 重置管理员密码
export const resetAdminPassword = (id) => {
  return request({
    url: `/admin/admins/${id}/password/reset`,
    method: 'post'
  })
}

// 获取系统日志
export const getSystemLogs = (params) => {
  return request({
    url: '/admin/system/logs',
    method: 'get',
    params
  })
}

// 清理系统缓存
export const clearSystemCache = () => {
  return request({
    url: '/admin/system/cache/clear',
    method: 'post'
  })
}

// 获取系统统计数据
export const getSystemStats = () => {
  return request({
    url: '/admin/system/stats',
    method: 'get'
  })
} 